﻿#include "role.h"

Role::Role(QObject *parent): QBaseEntity(parent)
{
    clear();
    const QMetaObject *metaObject = this->metaObject();
    setTableName(QString(metaObject->className()).toLower());
    setPrimaryKey("id");
    setUniqueKeys(QStringList() << "code");
    setNotNullKeys(QStringList() << "name"<<"code");
}

Role::Role(uint64_t id, QString name, QString code, QString description, int status)
{
    clear();
    const QMetaObject *metaObject = this->metaObject();
    setTableName(QString(metaObject->className()).toLower());
    setPrimaryKey("id");
    setUniqueKeys(QStringList() << "code");
    setNotNullKeys(QStringList() << "name"<<"code");
    this->id = id;
    this->name = name;
    this->code = code;
    this->description = description;
    this->status = status;
}

Role::~Role()
{

}

uint64_t Role::getId() const
{
    return id;
}

void Role::setId(const uint64_t &value)
{
    id = value;
}

QString Role::getName() const
{
    return name;
}

void Role::setName(const QString &value)
{
    name = value;
}

QString Role::getCode() const
{
    return code;
}

void Role::setCode(const QString &value)
{
    code = value;
}


QString Role::getDescription() const
{
    return description;
}

void Role::setDescription(const QString &value)
{
    description = value;
}

QStringList Role::getAuthoritys() const
{
    return authoritys;
}

void Role::setAuthoritys(const QStringList &value)
{
    authoritys = value;
}

int Role::getStatus() const
{
    return status;
}

void Role::setStatus(int value)
{
    status = value;
}

